<?php
/* @var $this CourseController */
/* @var $model Course */

Yii::app()->clientScript->registerScript('selectTeacher', ' 
    $("#sele").on("click", function() {
        var data = new Array();
        $("[type=checkbox]:not(:first):checked").each(function() {
                data.push($(this).val());
         });
         if (data.length <= 0)
         {
            data.push(0);
         }
            $.post(location.href, {"data[]": data}, function(res) {
                $("#notice").text(res);
            });
    });');

$this->breadcrumbs=array(
	'实验课程管理'=>array('admin'),
	'管理任课老师',
);

$this->menu=array(
	array('label'=>'返回', 'url'=>array('view', 'id'=>$id)),
	array('label'=>'返回实验课程管理', 'url'=>array('admin')),
	array('label'=>'创建新实验课程', 'url'=>array('create')),
);
?>

<h1>管理任课老师</h1>

<?php
$this->widget('zii.widgets.grid.CGridView', array(
        'id' => 'teacher-grid',
        'dataProvider' => $teachers->search(),
        'filter' => $teachers,
        'columns' => array(
                array(
                        'class' => 'CCheckBoxColumn',
                        'selectableRows' => 2,
                        'checked' => 'CourseTeacher::filterTeacher('. $id .', $data->teacher_id)',
                ),
                'teacher_name',
                'sex',
                'nation',
                'technical_position',
                'degree',
                'graduated'
        ),
));
?>

<div id="notice" style="color: red"></div>

<?php
echo CHtml::submitButton('提交', array('id'=>'sele'));
